package com.feicheng.common.config;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.springframework.stereotype.Component;

import com.feicheng.common.constant.Constant;

@Component
public class AdminHandlerInterceptor extends AbstractHandler {

//	@Override
	public boolean preHandle(
			HttpServletRequest request, 
			HttpServletResponse response, Object handler)
			throws Exception {
		HttpSession session = request.getSession();
		if (session.getAttribute(Constant.RESULT.CURRENT) == null) {
			authFailOutput(response);
			return false;
		}
		
		return true;
	}


}
